package fzu.functiongather.TimerCount;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import fzu.functiongather.R;
import fzu.functiongather.mUtils.Timer;

/**
 * Created by Administrator on 2016/8/17.
 */
public class TimerCountActivity extends Activity implements View.OnClickListener{
    private Button bt_timer;
    private Timer timer;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.timercount_main);
        initView();
        initWidget();
    }
    private void initView(){
        bt_timer=(Button)findViewById(R.id.bt_timer);
         timer=new Timer(60000, 1000,bt_timer);
    }
    private void initWidget(){
        bt_timer.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.bt_timer:
                timer.start();// 开始计时
                break;
        }
    }
}
